<template>
  <el-dialog :title="title" :close-on-click-modal="false" :fullscreen="true" :visible.sync="visible"
    :before-close="cancel" class="JNPF-dialog JNPF-dialog_center" lock-scroll width="50%">

    <div class="block">
    <el-timeline>
    <el-timeline-item timestamp="课程信息" placement="top">
      <el-card>
      <el-row class="JNPF-common-search-box" :gutter="8">
      <el-form @submit.native.prevent ref="elForm" :model="dataForm" :rules="rules">
        <el-col :span="8">
          <el-form-item label="申请单号" prop="FBILLNO">
            <el-input v-model="dataForm.FBILLNO"  disabled />
          </el-form-item>
        </el-col>

        <el-col :span="8">
          <el-form-item label="申请日期" prop="FBILLCREDATE">
            <el-date-picker v-model="dataForm.FBILLCREDATE" value-format="yyyy-MM-DD" type="date" placeholder="选择日期">
            </el-date-picker>
          </el-form-item>
        </el-col>

        <el-col :span="8">
            <el-form-item label="业务类型">
              <el-select v-model="dataForm.FBILLTYPE" placeholder="请选择">
                <el-option
                  v-for="item in options1"
                  :key="item.value"
                  :label="item.label"
                  :value="item.value">
                </el-option>
              </el-select>
            </el-form-item>
          </el-col>

        <el-col :span="16">
            <el-form-item label="机构名称">
              <el-select v-model="dataForm.FCATNAME" placeholder="请选择">
                <el-option
                  v-for="item in options2"
                  :key="item.value"
                  :label="item.label"
                  :value="item.value">
                </el-option>
              </el-select>
            </el-form-item>
          </el-col>

        <el-col :span="8">
            <el-form-item label="教育局">
              <el-select v-model="dataForm.FSCHOOL" placeholder="请选择">
                <el-option
                  v-for="item in options3"
                  :key="item.value"
                  :label="item.label"
                  :value="item.value">
                </el-option>
              </el-select>
            </el-form-item>
          </el-col>

        <el-col :span="8">
          <el-form-item label="办事人员" prop="FUSER">
            <el-input v-model="dataForm.FUSER" />
          </el-form-item>
        </el-col>

        <el-col :span="8">
          <el-form-item label="开始日期" prop="FBEGDATE">
            <el-date-picker v-model="dataForm.FBEGDATE" value-format="yyyy-MM-DD" type="date" placeholder="选择日期">
            </el-date-picker>
          </el-form-item>
        </el-col>

        <el-col :span="8">
          <el-form-item label="结束日期" prop="FENDDATE">
            <el-date-picker v-model="dataForm.FENDDATE" value-format="yyyy-MM-DD" type="date" placeholder="选择日期">
            </el-date-picker>
          </el-form-item>
        </el-col>

      </el-form>
      </el-row>
     </el-card>
    </el-timeline-item>

    <el-timeline-item timestamp=处理说明 placement="top">
      <el-card>
      <el-row class="JNPF-common-search-box" :gutter="16">
      <el-form @submit.native.prevent ref="elForm" :model="dataForm" :rules="rules">
       
        <el-col :span="24">
          <el-form-item label="处理说明" prop="FNOTE">
            <el-input
              type="textarea"
              :rows="2"
              placeholder="请输入内容"
              v-model="textarea">
            </el-input>
          </el-form-item>
        </el-col>

        <el-col :span="8">
            <el-form-item label="审批结果">
              <el-select v-model="dataForm.FBILLSTATE" placeholder="请选择">
                <el-option
                  v-for="item in options4"
                  :key="item.value"
                  :label="item.label"
                  :value="item.value">
                </el-option>
              </el-select>
            </el-form-item>
          </el-col>

        <el-col :span="8">
          <el-form-item label="审核人员" prop="FCHECKUSE">
            <el-input v-model="dataForm.FCHECKUSE"  disabled />
          </el-form-item>
        </el-col>

        <el-col :span="8">
          <el-form-item label="审核时间" prop="FCHECKDATE">
            <el-input v-model="dataForm.FCHECKDATE"   disabled/>
          </el-form-item>
        </el-col>

        <el-col :span="5">
          <el-form-item label="">
            <el-button type="success" icon="el-icon-plus" @click="closePage">保存</el-button>
            <el-button type="primary" :loading="loading"  @click="closePage">取消</el-button>
          </el-form-item>
        </el-col>
      </el-form>
      </el-row>

      </el-card>
    </el-timeline-item>

  </el-timeline>
</div>

  </el-dialog>
</template>
<script>
  import jnpf from "@/utils/jnpf"
  export default {
    components: {  },
    props: {
      formationlist: {
        type: Array,
        default: [],
      },
    },
    data() {
      return {
        textarea: '课件太老旧,需要更新',
        value1: new Date(2024, 12, 2, 12, 0),

        title: "新增",
        insertorupdate: true,
        dataForm: {
          FBILLNO: "K241130001", 
            FBILLCREDATE:"2024-11-29",
            FSCHOOL: "宝山区教育局",
            FCATNAME: "上海国际汽车城研学",
            FUSEDATE: "2024-12-01",
            FBEGDATE:"2024-12-01",
            FENDDATE:"2024-12-31",
            FMEMO: "有机化学实验操作课",
            FCHECKUSE: "曹植",
            FCHECKDATE: "2024-11-29 10:02:13",
            FUSER:"曹操",
            FBILLTYPE:"暂停显示",
            FBILLSTATE: "待审批"
        },
        rules: {
          FUSERNUMBER:[
            { required: true, message: '请输入学籍号码', trigger: 'blur' },
          ],
          FUSER: [
            { required: true, message: '请输入申请人员', trigger: 'blur' },
          ],
          FMEMO: [
            { required: true, message: '请输入申请理由', trigger: 'blur' },
          ],
        },
        list: [{  "FENTRYID":1,
                  "FGRAND": "第一实验楼",
                  "FLEVEL": "一楼",
                  "FPOINT": "201实验室"
                },
                { "FENTRYID":1,
                  "FGRAND": "第一实验楼",
                  "FLEVEL": "一楼",
                  "FPOINT": "202实验室"
                }],
        loading: false,
        visible: false,

        options3: [{
          value: '1',
          label: '宝山区教育局'
        }, {
          value: '2',
          label: '闵行区教育局'
        }],

        //所属校区选择数据
        options2: [{
          value: '1',
          label: '上海博物馆研学'
        }, {
          value: '2',
          label: '上海国际汽车城研学'
        }],

        options4: [{
          value: '1',
          label: '待审批'
        }, {
          value: '2',
          label: '已审批'
        }],

        //所属校区选择数据
        options1: [{
          value: '1',
          label: '暂停显示'
        }, {
          value: '2',
          label: '恢复显示'
        }, {
          value: '3',
          label: '淘汰课程'
        }],
        
      };
    },
    created() {
    },
    mounted() { },
    methods: {
      closePage(){
        console.log('关闭弹窗dialog');
        this.visible = false;
      },
      init(FBILLNO) {
        this.dataForm.FBILLNO = FBILLNO;
        if (this.dataForm.FBILLNO) {
          this.title = "修改"
          this.insertorupdate = false;
        }
        else {
          this.title = "新增"
          this.dataForm.FBILLNO = "K" + Math.floor(Math.random() * 10000000) + 1;
          this.insertorupdate = true;
        }
        this.visible = true;
      },
      shoplist(data) {
        data.forEach(item => {
          this.list.push({
            FBILLNO: this.dataForm.FBILLNO
            , FENTRYID: "1"
            , FYEAR: 2024
            , FGRADE: "大一"
            , FCLASS: "化学系1班"
            , FSTUDNAME: "曹操"
          },{
            FBILLNO: this.dataForm.FBILLNO
            , FENTRYID: "2"
            , FYEAR: 2024
            , FGRADE: "大一"
            , FCLASS: "化学系1班"
            , FSTUDNAME: "刘备"
          })
        });
      },
      //
      cancel() {
        this.list = [];
        this.visible = false;
      },
    },
  };
</script>